﻿@using PagedList.Mvc;
@model PagedList.IPagedList<DataAccess.DB.ThanhToan>
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
@{
    ViewBag.Title = "Thanh toán";
}

@using (Html.BeginForm("Index", "ThanhToan", FormMethod.Get))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Tìm kiếm</legend>

        <table>
            <tr>
                <td style="width: 20%">
                    <span>Mã DVCC:</span>
                </td>
                <td>
                    @Html.TextBox("txtSearch")
                </td>
            </tr>
            <tr>
                <td>Ngày thanh toán:
                </td>
                <td>
                    <span>Từ ngày :</span>@Html.TextBox("dtFrom", null, new { @style = "width:100px" })
                    <span>Đến ngày : </span>
                    @Html.TextBox("dtTo", null, new { @style = "width:100px" })
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center">
                    <input value="Tìm kiếm" type="submit" style="padding: 7px" />
                </td>
            </tr>
        </table>
    </fieldset>
}
<p style="padding: 0 0 20px 0">
    @Html.ActionLink("Tạo mới thanh toán", "Create", null, new { @class = "linkCreate" })
</p>
<table class="ms-list-form">
    <tr>
        <th>Đơn vị cung cấp
        </th>
        <th>Tiền thanh toán
        </th>
        <th>Ngày thanh toán
        </th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.DVCC.TenDVCC)
            </td>
            <td style="text-align: right">
                @Html.DisplayFor(modelItem => item.Price)
            </td>
            <td>
                @{if (item.Date != null)
                  {
                    @DuocThaiBinh.Common.Util.ConvertObjectToStringDateTime(item.Date)
                  }}
            </td>
            @*<td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>*@
        </tr>
    }

</table>
<script type="text/javascript">
    $(document).ready(function () {
        $("#dtFrom").datepicker();
        $("#dtTo").datepicker();
    });
</script>
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("Index", new { page }))